<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>pay</title>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
</head>
<body>
<input id="btn" type="button" value="" onclick="pay()" >

<script>
    (function ($) {
        $.getUrlParam = function (name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return decodeURI(r[2]); return null;
        }
    })(jQuery);
    var orderId = $.getUrlParam('orderId');
    var status = $.getUrlParam('status');

    if (status === "1"){
        $("#btn").val("付款")
    }
    if (status === "2"){
        $("#btn").val("已经付过")
    }
    if (status === "3"){
        $("#btn").val("未发货")
    }
    if (status === "4"){
        $("#btn").val("确认收货")
    }

    console.log(orderId);
    console.log(status);

    function pay() {

        var params = {
            orderId:orderId,
            status:status
        }
        $.ajax({
            url:"http://localhost:8010/order/update",
            data : params,
            type:'post',
            dataType: 'json'

        }).done(function (result) {

            alert("操作成功!!");
            // window.location.href="http://localhost:8001/front/html/my-orders.html"

        });
    }
</script>

</body>
</html>